// Angular2
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { AppModule } from './app.module';
declare var BUILD_IN_PRODUCTION;

// call to enable the production mode
if (BUILD_IN_PRODUCTION) {
  enableProdMode();
  disableLogger();
}

function disableLogger() {
  console.log = () => { };
  console.debug = () => { };
  console.info = () => { };
  // console.warn = () => {};
  // console.error = () => {};
}

// Angular 2 bootstrap
function main() {
  platformBrowserDynamic().bootstrapModule(AppModule);
}

if (document.readyState === 'complete') {
  main();
} else {
  document.addEventListener('DOMContentLoaded', main);
}

export default main;